Scene Motion Correction In Fused Image Systems

ABSTRACT

Techniques to capture and fuse short- and long-exposure images of a scene from a stabilized image capture device are disclosed. More particularly, the disclosed techniques use not only individual pixel differences between co-captured short- and long-exposure images, but also the spatial structure of occluded regions in the long-exposure images (e.g., areas of the long-exposure image(s) exhibiting blur due to scene object motion). A novel device used to represent this feature of the long-exposure image is a “spatial difference map.” Spatial difference maps may be used to identify pixels in the short- and long-exposure images for fusion and, in one embodiment, may be used to identify pixels from the short-exposure image(s) to filter post-fusion so as to reduce visual discontinuities in the output image.

BACKGROUND

The general class of techniques directed to reducing the image blur associated with camera motion may be referred to as “image stabilization.” In practice, image stabilization's primary goal is to reduce camera shake caused by the photographer's inability to quiesce their hand motion during image capture. Image stabilization may be used in binoculars, still and video cameras and astronomical telescopes. In still cameras, camera shake can be particularly problematic at slow shutter speeds or with long focal length (telephoto) lenses. With video cameras, camera shake can cause visible frame-to-frame jitter in the recorded video. In astronomical settings, the problem of lens-shake can be worsened by variations in the atmosphere which, over time, can cause the apparent positions of objects to change.

Image stabilization may be provided, for example, by mounting a camera to a stationary platform (e.g., a tripod) or by specialized image capture hardware. Devices employing the latter are generally referred to as having Optical Image Stabilization (OIS). Ideally, image stabilization compensates for all camera motion to produce an image in which the scene's static background is sharp even when captured with a long exposure time.

SUMMARY

In one embodiment the disclosed concepts provide an approach to capture multiple images of a scene using an image-stabilized platform (at least one having a short-exposure time and at least one having a long-exposure time). The captured images may be fused in such a manner that both stationary and moving objects are represented crisply and without ghosting artifacts in an output image. One method providing this capability includes obtaining at least one long-exposure image and at least one short-exposure image of a scene. From the short- and long-exposure images, a difference map may be generated where each value in the difference map has a corresponding pixel in each of the short- and long-exposure images. In one embodiment, for example, each difference value may be based on the difference between the value's corresponding pixels. In another embodiment, each difference value may be based on the difference between corresponding blocks or groups of pixels in the short- and long-exposure images. In still another embodiment, the difference map may be converted to a binary spatial difference map through application of a threshold, connected component analysis and trimming. Once the spatial difference map is generated, it may be used to fuse the short- and long-exposure images into an output image.

In one embodiment, the short- and long-exposure images may be fused based on both the spatial difference map and a weight mask (itself based on the short- and long-exposure images). By way of example, a binary spatial difference map may be used to identify a first set of pixels from the short-exposure image and a second set of pixels from the long-exposure image. The first set of pixels (from the short-exposure image) may be blended with their corresponding long-exposure image pixels in accordance with the weight mask and placed into a temporary image. Pixels in the second set of pixels may be passed through to the temporary image. An output image may be generated by filtering the fused temporary image to remove or suppress noise. In one embodiment for example, de-noising may be applied more strongly to pixels where the contribution comes primarily from short-exposure image 200 (i.e., from the first set of pixels) and less strongly where the contribution comes primarily from long-exposure image 205 (i.e., from the second set of pixels). Also disclosed herein is an electronic device and a non-transitory program storage device having instructions stored thereon for causing one or more processors or computers to perform the described methods.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows, in flow chart form, an image capture operation in accordance with one embodiment.

FIG. 2 shows, in flow chart form, a spatial difference map generation operation in accordance with one embodiment.

FIGS. 3A and 3B illustrate the difference between a difference map and a spatial difference map in accordance with one embodiment.

FIGS. 4A-4C show illustrative approaches to combining pixels from short- and long-duration images in accordance with various embodiments.

FIG. 5 shows, in flow chart form, a spatial difference map generation operation in accordance with another embodiment.

FIG. 6 shows, in flow chart form, an image fusion operation in accordance with one embodiment.

FIG. 7 shows, in flow chart form, an image fusion operation in accordance with another embodiment.

FIGS. 8A-8C show short-exposure, long-exposure and fused output images captured in accordance with one embodiment.

FIG. 9 shows, in block diagram form, a multi-function electronic device in accordance with one embodiment.

DETAILED DESCRIPTION

This disclosure pertains to systems, methods, and computer readable media to improve image capture operations from an stabilized image capture device. In general, techniques are disclosed for capturing and fusing short- and long-exposure images of a scene from stabilized image capture devices. More particularly, techniques disclosed herein use not only the individual pixel differences between co-captured short- and long-exposure images (as do prior art difference maps), but also the spatial structure of occluded regions in the long-exposure images (e.g., areas in the long-exposure image(s) exhibiting blur due to motion of objects in the scene). A novel device used to represent this feature of the long-exposure image is a “spatial difference map.” The spatial difference map may be used to identify pixels in the short- and long-exposure images for fusion and, in one embodiment, may be used to identify pixels from the short-exposure image(s) that can be filtered to reduce visual discontinuities (blur) in the final output image. As used herein the terms “digital image capture device,” “image capture device” or, more simply, “camera” are meant to mean any instrument capable of capturing digital images (including still and video sequences).

In the following description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the inventive concept. As part of this description, some of this disclosure's drawings represent structures and devices in block diagram or flow chart form in order to avoid obscuring the invention. In the interest of clarity, not all features of an actual implementation are described. Moreover, the language used in this disclosure has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter, resort to the claims being necessary to determine such inventive subject matter. Reference in this disclosure to “one embodiment” or to “an embodiment” means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the invention, and multiple references to “one embodiment” or “an embodiment” should not be understood as necessarily all referring to the same embodiment.

It will be appreciated that in the development of any actual implementation (as in any development project), numerous decisions must be made to achieve the developers' specific goals (e.g., compliance with system- and business-related constraints), and that these goals may vary from one implementation to another. It will also be appreciated that such development efforts might be complex and time-consuming, but would nevertheless be a routine undertaking for those of ordinary skill in the design an implementation of image processing systems having the benefit of this disclosure.

Referring to FIG. 1, image capture operation 100 in accordance with one embodiment begins when image capture device 105 captures multiple images 110 of a scene (block 115). In one embodiment, images 110 include one short-exposure image (designated “S”) and one stabilized long-exposure image (designated “L”) in the sequence SL or LS. Illustrative short-exposure times are between 1/15 second and 1/60 second and are, in general, selected based on the scene's LUX level. In some embodiments, there can be an f-stop limit between the short- and long-exposure settings (e.g., 2 or 3 stops). The stabilized long-exposure image provides a sharp representation of a scene's static areas (i.e., those areas in which no scene object motion occurs). The short-exposure image(s) capture a sharp but noisy representation of the scene where blur caused by moving objects is significantly reduced (compared to the long-exposure image). In another embodiment, images 110 may include multiple short-exposure images along with the stabilized long-exposure image in the sequence S . . . SL, LS . . . S, SLS or S . . . SLS . . . S. In these embodiments, some or all of the short-exposure images may be fused to provide a single reduced-noise short-exposure image that may then be used in accordance with this disclosure. In still another embodiment, images 110 may include two or more stabilized long-exposure images and one or more short-exposure images in sequences such as L . . . SL . . . , S . . . LL . . . S . . . , L . . . S . . . L . . . . In embodiments of this nature, the multiple long-exposure images may be fused together to provide a single reduced-noise long-exposure image. It is noted that, in general, the further in time a captured short-exposure image is from the stabilized long-exposure image, the less meaningful it may be vis-à-vis correctly identifying highly correlated scene object motion in the long-exposure images. In one or more embodiments, the gains of the short- and long-exposure images may be controlled so that the brightness of the two images are “approximately” matched. (As used here, the term “approximate” generally means that two quantities are matched well enough so as to satisfy the operational goals of the implementation.) Matching the brightness of short- and long-exposure images allows more efficient and accurate alignment and de-ghosting then could be otherwise achieved. It will be understood that when used, this feature can result in the gain of short-exposure images being considerably higher than the gain for long-exposure images.

Once captured, the (reduced-noise) long-exposure and (reduced-noise) short-exposure images may be registered (120). Once registered, the short- and long-exposure images may be used to generate a spatial difference map (block 125). As used herein, a spatial difference map is an object whose element values represent the difference (or similarity) between two images and which also accounts for the spatial relationships between the two images from which it is formed. (See discussion below with respect to FIGS. 2 and 5.) The spatial difference map may then be used to fuse the short- and long-exposure images (block 130) to generate final output image 135.

Referring to FIG. 2, spatial difference map generation operation 125 in accordance with one embodiment begins when short- and long-exposure images 200 and 205 are received. (As noted above, short-exposure image 200 may represent a reduced-noise short-exposure image and long-exposure image 205 may represent a reduced-noise long-exposure image.) From short- and long-exposure images 200 and 205, difference map 210 may be generated (block 215). By way of example, each element in difference map 210 may have a value equal to the arithmetic difference, the absolute difference, the mean absolute difference or the mean squared difference between the value's corresponding short- and long-exposure image pixels. In one embodiment, difference map element values may be based on the difference in luminance values. In another embodiment, difference map element values may be based on image color component values (e.g., red (R) or green (G) or blue (B) component values). In yet another embodiment, difference map element values may be based on a combined pixel color value (e.g., a single RGB or chrominance value). The particular type of difference chosen can be based on the specific purpose for which the image capture device is designed, the environment in which the device is to operate or a myriad of other factors that one of ordinary skill in the art would take into consideration.

Once generated, a threshold may be applied to each element in difference map 210 (block 220) to obtain binary difference map 225: values above the specified threshold may be set to a “1,” while values below or equal to the specified threshold may be set to a “0.” Threshold selection may, for example, be based on an a priori noise model but does not, in accordance with this disclosure, require a high level of precision because image fusion is also a function of the spatial relationships between difference map elements (blocks 230-235) and the manner in which noise may be used to adaptively filter select short-exposure image pixels after image fusion operations in accordance with block 130 (see discussion below).

Binary difference map 225 may be analyzed to identify elements that are “connected” (block 230). In one embodiment, for example, a first element is “connected” to its immediate neighbor if both elements are equal to 1. Unique groups of elements that are all connected may be referred to collectively as a “component” or a “connected component.” Once identified, all components having less than a specified number of elements (“component-threshold”) may be removed (block 235), resulting in spatial difference map 240. In an embodiment where images have 8 Mpix resolution, the component-threshold value may be 50 so that acts in accordance with block 235 will remove (i.e. set to zero) all elements in binary difference map 225 which are connected to fewer than 49 other binary map elements. It has been found that a “too small” component-threshold can result in a noisy image, whereas a “too large” component-threshold can risk allowing large moving objects to appear blurred. Because of this, the component-threshold can depend at least on image resolution and the pixel size of the largest object the developer is willing to risk appearing blurry in the final image. The number 50 here was selected because a 50 pixel moving object may be insignificantly small in an 8 Mpix image, and hence even if it happens to be blurred may not be noticeable. If the object is affected by motion blur, then the selected size (e.g., 50 pixels) includes not only the object itself but also its blur trail, so the actual object can be much smaller than 50 pixels. In addition, it has been determined that the noise level is also important. For example, if the short-exposure image has a higher noise level (e.g., large gain) then a larger threshold may be acceptable in order to compensate for noise.

Conceptually, spatial difference map 240 may be thought of as representing the stability or “static-ness” of long-exposure image 205. (As previously noted, long-exposure image 205 may represent a reduced-noise long-exposure image.) For example, long-exposure image pixels corresponding to spatial difference map elements having a “0” value most likely represent stationary objects so that the output image's corresponding pixels should rely on the long-exposure image. On the other hand, long-exposure image pixels corresponding to spatial difference map elements having a “1” value most likely represent moving objects so that the output image's corresponding pixels should rely on the short-exposure image.

Referring to FIG. 3A, binary difference map 225 generated in accordance with block 220 is shown along side spatial difference map 240 generated in accordance with block 235 in FIG. 3B. Inspection of these figures shows spatial difference map 240 has large white areas (representing stationary objects). In these same areas, binary difference map 225 is speckled with dark elements (representing non-stationary objects). It has been found, quite unexpectedly, that the use of spatial difference maps in accordance with this disclosure can have significant and beneficial consequences to the generation of output image because the proper identification of stationary objects allows full use of the stabilized long-exposure image, resulting in a higher quality output image.

Acts in accordance with block 215 may find pixel-to-pixel or block-to-block differences. In the former, corresponding single pixels from short- and long-exposure images 200 and 205 may be used to generate a difference value. In the latter, corresponding neighborhoods from short- and long-exposure images 200 and 205 may be used to generate a difference value. Referring to FIG. 4A, illustrative pixel-to-pixel operation combines pixel S9 from short-exposure image 200 and corresponding pixel L9 from long-exposure image 205 to generate a difference value for element D9 of difference map 210. Referring to FIG. 4B, illustrative block-to-block operation combines pixels S1→S9 from short-exposure image 200 and corresponding pixels L1→L9 from short-exposure image 205 to generate a value for element D5 of difference map 210. Here, a 9 pixel neighborhood for each pair of corresponding pixels in the short- and long-exposure images 200 and 205 are used to generate each difference map element value. The size of the neighborhood used and how each pixel value is combined in this approach is up to the developer and should be chosen so as to satisfy their system- and business goals.

One of ordinary skill in the art will recognize that during operations in accordance with FIG. 4B various “boundary conditions” will arise. For example, how should the neighborhood for pixel S1 in short-duration image 200 and corresponding pixel L1 in long-exposure image 205 be determined? Referring to FIG. 4C, one illustrative approach to dealing with boundary conditions is to “fake” the necessary pixels (i.e., pixels SA→SE and LA→LE). Values for these non-existent pixels may be set in any one of a number of ways. For example, each value may be set equal to the average of all of the neighborhood's actual pixels (e.g., pixels S1, S2, S4, and S5 in short-exposure image 200 and L1, L2, L4 and L5 in long-exposure image 205). Other approaches to setting boundary pixel values will be known to those of ordinary skill in the art.

Referring to FIG. 5, spatial difference map generation operation 125 in accordance with another embodiment may use pyramid decomposition techniques. To begin, short- and long-duration images 200 and 205 are each decomposed (block 500) into pyramid representations 505 and 510 (e.g., via Gaussian, Laplacian, Steerable or wavelet/QMF techniques). Next, the difference between the top levels of pyramids 505 and 510 may be found (e.g., level k). As before, this difference may be any one of a number of different types: arithmetic difference, the absolute difference, the mean absolute difference, the mean squared difference, etc. For any subsequent level down to level 0 (image resolution), the local difference for each pixel (x,y) may be found and adjusted based on the corresponding difference calculated in the immediately higher level at pixel (x/2,y/2). This adjustment can be, for instance, a weighted average between the current difference and that calculated in the immediately higher level. After processing level 0 (image resolution), pyramid difference map 515 will be a map whose isolated pixels have had their differences diminished, whereas large areas corresponding to occluded objects in long-exposure image 205 will have larger difference values (block 520). At this point, a threshold may be applied to pyramid difference map 515 (block 525) to generate spatial difference map 225.

In one embodiment, a threshold can be calculated based on the image sensor's noise level. A noise model that describes each pixel's expected noise value as a function of pixel intensity and color may be known a priori or can be measured for a particular camera type and device. In another embodiment, a noise model can be determined for every level in pyramids 505 and 510. By way of example, in a Gaussian pyramid the noise tends to be smaller at lower resolution levels because the individual pixels have been obtained by applying low pass filters (smoothing) to the higher resolution levels. The difference between the two images at each level may be scaled to the corresponding noise standard deviation at each level (or some other implementation meaningful statistic). This can have the effect of scaling or normalizing the calculated differences which may then be used during acts in accordance with block 520. In accordance with this embodiment, once pyramid level-0 is reached the combined difference is already normalized for the noise level in every pixel and hence a threshold may be selected by visual tuning regardless of the noise level in the particular images.

In still another embodiment, a difference map (at least initially real-valued) may by determined using the “optical flow” between the stabilized long-exposure (or reduced-noise long-exposure) image—aka, the reference image—and the short-exposure (or reduced-noise short-exposure) image. The initial result of this approach will be to generate a difference map that is similar in function to pyramid difference map 515. From there a threshold may be applied (e.g., as in block 525), to generate spatial difference map 240. Without optical flow, a pixel at a position (x,y) in one image is compared with a pixel at the corresponding position (x,y) in another image, assuming the two images have been globally registered (aligned one with respect to another). By introducing optical flow in accordance with this disclosure, a pixel at position (x,y) in one image may be compared with a pixel in another image which may be at a different position (x′,y′) calculated in accordance with the optical flow. The difference map may also be used with optical flow so that a difference map value at position (x,y) reflects the relationship between pixel (x,y) in a reference image and pixel (x′,y′) in another (non-reference) image, where (x′,y′) may be determined by the optical flow. In practice, the optical flow can be progressively estimated starting from the coarsest pyramid level (level k) to the finest level (level 0). At every level the optical flow estimated in the previous level can be updated in accordance with the change in resolution.

Referring to FIG. 6, image fusion operation 130 in accordance with one embodiment uses spatial difference map 240 to identify output image pixels that originate in long-exposure image 205 (block 600). In the approach adopted herein, long-exposure image pixels corresponding to “0” values in spatial difference map 240 may be selected in accordance with block 600. The binary nature of spatial difference map 240 also identifies pixels from short-exposure image 200 (block 605)—i.e., those pixels corresponding to “1” values in spatial difference map 240. Those pixels identified in accordance with block 605 are blended with their corresponding pixels from long-exposure image 205 while those pixels identified in accordance with block 600 are carried through to form intermediate output image 615 (block 610). Because spatial difference map 240 in accordance with this disclosure efficiently identifies those regions in long-exposure image 205 corresponding to static or stationary portions of the captured scene, the use of pixels directly from short-exposure image 200 can lead to visual discontinuities where pixels from short- and long-exposure images 200 and 205 abut in intermediate output image 615. To compensate for this effect, pixels selected from short-exposure image 200 in accordance with block 605 may be filtered to generate output image 135 (block 620).

Referring now to FIG. 7, operations 600-620 in accordance with one embodiment are shown in detail. To begin, block 700 uses spatial difference map 240 to selectively determine short-exposure image pixels 705 and long-exposure image pixels 710 for further processing. To enable local filtering of selected short-exposure image pixels 705, block 715 uses spatial difference map 240 and short- and long-exposure images 200 and 205 to generate real-valued difference map 720 (as described here, the calculated real-valued weights may be between 0 and 1, although other ranges are also possible). In one embodiment, block 715 uses pixel-by-pixel differences to generate real-valued difference map 720 (see FIG. 4A and associated discussion). In another embodiment, block 715 uses block-by-block differences to generate real-valued difference map 720 (see FIGS. 4B-4C and associated discussion).

Real-valued difference map 720 may be used to generate weight mask 725 by operation 735. In one embodiment, for example, operation 730 may generate weight mask 725 in accordance with:

W=1−e ^((−0.5)R/a)) ² ⁾,  EQ. 1

where W represents weight mask 725, R represents real-valued difference map 720, and ‘a’ is a parameter that may be based on short-exposure image 200's noise's standard deviation, a combined noise standard deviation of short- and long-exposure images 200 and 205, or another noise statistic. In general, EQ. 1 is an increasing function of R that takes values between 0 and 1. In accordance with illustrative EQ. 1, when the difference between corresponding short- and long-exposure pixel values is small, the corresponding weight value will be close to 0; when the difference between corresponding short- and long-exposure pixel values is large, the corresponding weight value will be close to 1. In the embodiments described herein, weight values in accordance with EQ. 1 are only used in areas where spatial difference map 240 requires contribution from short-exposure image 200 (e.g., those pixels identified in O_(S) 705). In all other areas, long-exposure image 205 is static and, therefore, only those areas contribute to output image 135. Weight mask 725 may be used to fuse short- and long-exposure images 200 and 205 (via images O_(S) 705 and O_(L) 710) to form intermediate output image 615 in accordance with operation 735:

I=WMS+(1−WM)L,  EQ. 2

where I represents intermediate output image 615, W represents weight mask 725, M represents spatial difference map 240, S represents short-exposure image 200 and L represents long-exposure image 205. The function of EQ. 2 may be applied directly in the image domain or in a transform domain (e.g., via pyramid decomposition). Here, when a value in spatial difference map 240 equals 0, the corresponding pixel in intermediate output image 615 will be the corresponding pixel from long-exposure image 205. When a value in spatial difference map 240 is non-zero, the corresponding pixel in intermediate output image 615 will be the weighted combination of the corresponding pixels from short- and long-exposure images 200 and 205. Once short- and long-exposure images 200 and 205 are fused in accordance with block 735, intermediate output image 615 may be filtered in accordance with block 740 to produce output image 135. In one embodiment, block 740 may use information about the noise level in each pixel to determine how strongly or weakly to de-noise a pixel. Typically, the noise level in each pixel may be determined based on the pixel's intensity and color in accordance with a noise model that has been determined a priori for a particular camera and device. In one embodiment, noise filter 740 may reduce the noise in each pixel of intermediate output image 615 based on an estimate of the noise level in each pixel after fusion. A consequence of this approach is that de-noising is applied more strongly to pixels where the contribution comes primarily from short-exposure image 200 and less strongly where the contribution comes primarily from long-exposure image 205. One implementation of this approach first estimates the noise in each pixel of short- and long-exposure images 200 and 205 (e.g., via the image capture device's noise model/characterization). For example, if σ_(S) represents the noise standard deviation of a short-exposure image pixel and σ_(L) the noise standard deviation of the corresponding long-exposure image pixel, the noise standard deviation in fused intermediate output image 615 may be approximated by:

σ₁=√{square root over ((WM)²σ_(S) ²+(1−WM)²σ_(L) ²)}{square root over ((WM)²σ_(S) ²+(1−WM)²σ_(L) ²)},  EQ. 3

where σ₁ represents the estimated noise standard deviation of the intermediate output image pixel corresponding to the short- and long-exposure image pixels, W represents the weight mask value corresponding to the output image pixel and M represents the spatial difference map value corresponding to the intermediate output image pixel. Applying this value (or these values—one for each pixel in the short- and long-exposure images) for noise filter 740 may result in more de-noising (stronger filtering) in areas in short-exposure image 200 having a larger contribution in output image 135, and less de-noising (weaker filtering) in areas in short-exposure image 200 having a smaller contribution in output image 135.

By way of example, FIGS. 8A-8C show the result of using an 8 MPix embedded image capture device in accordance with the approach described herein on a long-short capture sequence (i.e., a long-exposure image followed immediately by a short-exposure image). Long-exposure image shown in FIG. 8A was captured using a 250 msec exposure time and an ISO of 64. Short-exposure image shown in FIG. 8B was captured using a 30 msec exposure time and an ISO of 500. Fused output image 8C was generated using pyramid decomposition (no optical flow) with the difference map computed on a block-by-block basis (e.g., in accordance with FIGS. 1, 2, 5, 6 and 7).

In another embodiment, a short-long-short capture sequence may be used: a first stabilized short-exposure image is captured, followed immediately by a stabilized long-exposure image, followed immediately by a second stabilized short-exposure image. Here, motion between the two short-exposure images may be used to accurately identify areas in motion/exhibiting blur in the long-exposure image. Based on a difference map of the two short-exposure images, areas of the scene where objects have changed position may be identified. Because the long-exposure image was captured in between the two short-exposure images, the identified objects must have been moved during capture of the long-exposure image and, as a result, may be blurred in the long-exposure image. These areas could be marked as “moving” in spatial difference map 240. This, in turn, may result in the corresponding areas in output image 135 being determined based on the short-exposure images. In addition, if the two short-exposure images are captured under the same conditions (exposure time and gain), the resulting difference may be more robust. The robustness comes from the fact that the noise characteristics of the two short-exposure images are substantially identical, due to their similar exposures. Areas that are declared as moving between the two short-exposure images are areas that could be marked as blurry in spatial difference map M. Nevertheless, after combining the two short-exposure images into a reduced-noise short-exposure image, the fusion between the long-exposure (L) and the reduced-noise short-exposure image may be performed in accordance with FIG. 7. (The only difference here is that in the spatial difference map M certain areas are already marked as blurry, and hence only the remaining areas need be analyzed.) The SLS capture sequence also results in two short-exposure images that are “closest in time” to the long-exposure image as compared, for example, to SSL or LSS capture sequences. The two short-exposure images may be fused to create a reduced-noise short-exposure image that may be processed in accordance with this disclosure and, ultimately, fused with the long-exposure image.

Referring to FIG. 9, a simplified functional block diagram of illustrative electronic device 900 is shown according to one embodiment. Electronic device 900 could be, for example, a mobile telephone, personal media device, portable camera, or a tablet, notebook or desktop computer system. As shown, electronic device 900 may include processor 905, display 910, user interface 915, graphics hardware 920, device sensors 925 (e.g., proximity sensor/ambient light sensor, accelerometer and/or gyroscope), microphone 930, audio codec(s) 935, speaker(s) 940, communications circuitry 945, image capture circuit or unit 950, video codec(s) 955, memory 960, storage 965, and communications bus 970. Processor 905 may execute instructions necessary to carry out or control the operation of many functions performed by device 900 (e.g., such as the generation and/or processing of images in accordance with FIGS. 1-8). Processor 905 may, for instance, drive display 910 and receive user input from user interface 915. User interface 915 can take a variety of forms, such as a button, keypad, dial, a click wheel, keyboard, display screen and/or a touch screen. User interface 915 could, for example, be the conduit through which a user may view the result of image fusion in accordance with this disclosure. Processor 905 may be a system-on-chip such as those found in mobile devices and include one or more dedicated graphics processing units (GPUs). Processor 905 may be based on reduced instruction-set computer (RISC) or complex instruction-set computer (CISC) architectures or any other suitable architecture and may include one or more processing cores. Graphics hardware 920 may be special purpose computational hardware for processing graphics and/or assisting processor 905 perform computational tasks. In one embodiment, graphics hardware 920 may include one or more programmable graphics processing units (GPUs). Image capture circuitry 950 may capture still and video images that may be processed to generate images scene motion processed images in accordance with this disclosure. Output from image capture circuitry 950 may be processed, at least in part, by video codec(s) 955 and/or processor 905 and/or graphics hardware 920, and/or a dedicated image processing unit incorporated within circuitry 950. Images so captured may be stored in memory 960 and/or storage 965. Memory 960 may include one or more different types of media used by processor 905, graphics hardware 920, and image capture circuitry 950 to perform device functions. For example, memory 960 may include memory cache, read-only memory (ROM), and/or random access memory (RAM). Storage 965 may store media (e.g., audio, image and video files), computer program instructions or software, preference information, device profile information, and any other suitable data. Storage 965 may include one more non-transitory storage mediums including, for example, magnetic disks (fixed, floppy, and removable) and tape, optical media such as CD-ROMs and digital video disks (DVDs), and semiconductor memory devices such as Electrically Programmable Read-Only Memory (EPROM), and Electrically Erasable Programmable Read-Only Memory (EEPROM). Memory 960 and storage 965 may be used to retain computer program instructions or code organized into one or more modules and written in any desired computer programming language. When executed by, for example, processor 905 such computer program code may implement one or more of the methods described herein. It is to be understood that the above description is intended to be illustrative, and not restrictive. The material has been presented to enable any person skilled in the art to make and use the invention as claimed and is provided in the context of particular embodiments, variations of which will be readily apparent to those skilled in the art (e.g., some of the disclosed embodiments may be used in combination with each other). For example, two or more short-exposure images may be captured while only a single long-exposure image may be used in accordance with this disclosure. Further, FIGS. 1, 2 and 5-7 show flowcharts illustrating various aspects in accordance with the disclosed embodiments. In one or more embodiments, one or more of the illustrated steps may be omitted, repeated, and/or performed in a different order. Accordingly, the specific arrangement of steps shown in these figures should not be construed as limiting the scope of the technique. The scope of the invention therefore should be determined with reference to the appended claims, along with the full scope of equivalents to which such claims are entitled. In the appended claims, the terms “including” and “in which” are used as the plain-English equivalents of the respective terms “comprising” and “wherein.” 

1. A non-transitory program storage device comprising instructions stored thereon, the instructions readable by a processor and configured to cause one or more processors to: obtain a long-exposure image of a scene, the long-exposure image having pixels; obtain a short-exposure image of the scene contemporaneously with the long-exposure image, the short-exposure image having pixels wherein each pixel in the short-exposure image has a corresponding pixel in the long-exposure image; generate a difference map based on the short- and long-exposure images, the difference map having values wherein each value has a corresponding pixel in each of the short- and long-exposure images; identify one or more connected-components in the difference map, wherein each connected component comprises one or more values; nullify at least some of the identified one or more connected components to generate a spatial difference map, wherein each nullified connected component comprises less than a specified number of values; and fuse the short- and long-exposure images based on the spatial difference map.
 2. The non-transitory program storage device of claim 1, wherein the instructions to cause the one or more processors to obtain a short-exposure image comprise instructions to cause the one or more processors to: obtain a plurality of first short-exposure images; and combine the plurality of first short-exposure images to generate the short-exposure image.
 3. The non-transitory program storage device of claim 1, wherein the instructions to cause the one or more processors to obtain a long-exposure image comprise instructions to cause the one or more processors to: obtain a plurality of first long-exposure images; and combine the plurality of first long-exposure images to generate the long-exposure image.
 4. The non-transitory program storage device of claim 1, wherein each value in the difference map is based on a block of pixels in the short-exposure image and a corresponding block of pixels in the long-exposure image.
 5. The non-transitory program storage device of claim 1, wherein the instructions to cause the one or more processors to generate a difference map further comprise instructions to cause the one or more processors to apply a first threshold to each value in the difference map to convert each value in the difference map to a binary value.
 6. The non-transitory program storage device of claim 1, wherein the instructions to cause the one or more processors to generate a difference map comprise instructions to cause the one or more processors to generate a difference map in accordance with optical flow analysis.
 7. The non-transitory program storage device of claim 5, wherein the instructions to cause the one or more processors to identify one or more connected-components comprise instructions to cause the one or more processors to identify, as a connected component, any pair of non-zero values that are directly adjacent in the difference map.
 8. The non-transitory program storage device of claim 1, wherein the instructions to cause the one or more processors to fuse the short- and long-exposure images comprise instructions to cause the one or more processors to: identify a first plurality of pixels from the short-exposure image based on the spatial difference map; identify a second plurality of pixels from the long-exposure image based on the spatial difference map; determine a weight mask based, at least in part, on the short-exposure image, the long-exposure image and the spatial difference map; and generate an intermediate output image based on the short-exposure image, the long-exposure image and the weight mask.
 9. The non-transitory program storage device of claim 8, further comprising instructions to cause the one or more processors to filter the intermediate output image to generate an output image.
 10. The non-transitory program storage device of claim 9, wherein the instructions to cause the one or more processors to filter the intermediate output image comprise instructions to cause the one or more processors to filter each pixel in the intermediate output image in a manner that is inversely proportional to the amount of noise in the pixel.
 11. An electronic device, comprising: an image capture unit; a memory operatively coupled to the image capture unit; and one or more processors operatively coupled to the memory and configured to execute instructions stored in the memory, the instructions configured to cause the one or more processors to— capture, by the image capture unit, a long-exposure image having pixels; store the long-exposure image in the memory; capture, by the image capture unit, a short-exposure image having pixels, wherein each pixel in the short-exposure image has a corresponding pixel in the long-exposure image; store the short-exposure image in the memory; generate, in the memory, a difference map based on the short- and long-exposure images, the difference map having values wherein each value has a corresponding pixel in each of the short- and long-exposure images; identify one or more connected-components in the difference map, wherein each connected component comprises one or more values; nullify at least some of the identified one or more connected components to generate a spatial difference map, wherein each nullified connected component comprises less than a specified number of values; and fuse, in the memory, the short- and long-exposure images based on the spatial difference map.
 12. The electronic device of claim 11, wherein the instructions to cause the one or more processors to capture a short-exposure image comprise instructions to cause the one or more processors to: obtain, from the image capture unit, a plurality of first short-exposure images; fuse the plurality of first short-exposure images to generate the short-exposure image; and store the short-exposure image in the memory.
 13. The electronic device of claim 11, wherein the instructions to cause the one or more processors to generate a difference map further comprise instructions to apply a first threshold to each value in the difference map to convert each value in the difference map to a binary value.
 14. The electronic device of claim 11, wherein the instructions to cause the one or more processors to generate a difference map comprise instructions to cause the one or more processors to generate a difference map in accordance with optical flow analysis.
 15. The electronic device of claim 13, wherein the instructions to cause the one or more processors to identify one or more connected-components comprise instructions to cause the one or more processors to identify, as a connected component, any pair of non-zero values that are directly adjacent in the difference map.
 16. The electronic device of claim 11, wherein the instructions to cause the one or more processors to fuse the short- and long-exposure images based on the spatial difference map comprise instructions to cause the one or more processors to: identify a first plurality of pixels from the short-exposure image based on the spatial difference map; identify a second plurality of pixels from the long-exposure image based on the spatial difference map; determine a weight mask based, at least in part, on the short-exposure image, the long-exposure image and the spatial difference map; and generate an intermediate output image based on the short-exposure image, the long-exposure image and the weight mask.
 17. The electronic device of claim 16, further comprising instructions to cause the one or more processors to filter the intermediate output image to generate an output image.
 18. The electronic device of claim 17, wherein the instructions to cause the one or more processors to filter the intermediate output image comprise instructions to cause the one or more processors to filter each pixel in the intermediate output image in a manner that is inversely proportional to the amount of noise in the pixel.
 19. A method comprising: obtaining a long-exposure image of a scene, the long-exposure image having pixels; obtaining a short-exposure image of the scene, the short-exposure image having pixels wherein each pixel in the short-exposure image has a corresponding pixel in the long-exposure image; generating a difference map based on the short- and long-exposure images, the difference map having values wherein each value has a corresponding pixel in each of the short- and long-exposure images; identifying one or more connected-components in the difference map, wherein each connected component comprises a plurality of values; nullifying at least some of the identified connected components comprising less than a specified number of values to generate a spatial difference map; and fusing the short- and long-exposure images based on the spatial difference map.
 20. The method of claim 19, wherein each value in the difference map is based on a block of pixels in the short-exposure image and a corresponding block of pixels in the long-exposure image.
 21. The method of claim 19, wherein the act of generating a difference map further comprises applying a first threshold to each value in the difference map to convert each value to a binary value.
 22. The method of claim 21, wherein identifying one or more connected-components comprise identifying, as a connected component, all pairs of non-zero values that are directly adjacent in the difference map.
 23. The method of claim 20, wherein fusing the short- and long-exposure images comprise: identifying a first plurality of pixels from the short-exposure image based on the spatial difference map; identifying a second plurality of pixels from the long-exposure image based on the spatial difference map; filtering the first plurality of pixels based on each of the first plurality of pixel's corresponding value in the difference map; and fusing the filtered first plurality of pixels and the second plurality of pixels to generate an output image. 